<?php

namespace App\Services\MakeUserDeliveryAddress;

use App\Http\Controllers\Api\V1\Requests\FormRequest;

class MakeUserDeliveryAddressRequest extends FormRequest
{
	public function rules(): array
	{
		return [
			'id_code'           => 'nullable|string',
			'id_name'           => 'nullable|string',
			'contact_name'      => 'required',
			'contact_phone'     => 'required|phone:CN,mobile',
			'province_code'     => 'required|digits:6',
			'city_code'         => 'required|digits:6',
			'district_code'     => 'required|digits:6',
			'province'          => 'required|string',
			'city'              => 'required|string',
			'district'          => 'required|string',
			'address'           => 'required|string',
			'is_default'        => 'required|boolean',
		];
	}

	public function attributes(): array
	{
		return [
			'id_code'           => '证件号码',
			'id_name'           => '证件姓名',
			'contact_name'      => '姓名',
			'contact_phone'     => '电话',
			'province'          => '省',
			'city'              => '城市',
			'district'          => '地区',
			'address'           => '详细地址',
			'zip'               => '邮编',
			'is_default'        => '默认地址',
		];
	}
}
